#include <iostream>
#include <vector>
#include <algorithm>

int main(int argc, char** argv) {

  std::vector<int>  num_vec1;
  for (int i = 0; i < 500; i++) {
    num_vec1.push_back(i);
  }

  std::cout << "num_vec1 size(): " << num_vec1.size() << std::endl;
  std::cout << "num_vec1 capity()" << num_vec1.capacity() << std::endl;

  std::vector<int> num_vec2;
  for (int i = 0; i < 200; i++) {
    num_vec2.push_back(i);
  }
  std::cout << "num_vec2 size(): " << num_vec2.size() << std::endl;
  std::cout << "num_vec2 capity()" << num_vec2.capacity() << std::endl;
  
  std::cout << "clear numvec2" << std::endl;
  num_vec2.clear();
  std::cout << "num_vec2 size(): " << num_vec2.size() << std::endl;
  std::cout << "num_vec2 capity()" << num_vec2.capacity() << std::endl;
  
  std::cout << "reserve and resize numvec2" << std::endl;
  num_vec2.reserve(num_vec1.size());
  num_vec2.resize(num_vec1.size());
  std::cout << "copy numvec1 to numvec2" << std::endl;
  std::copy(num_vec1.begin(), num_vec1.end(), num_vec2.begin());
  std::cout << "num_vec2 size(): " << num_vec2.size() << std::endl;
  std::cout << "num_vec2 capity()" << num_vec2.capacity() << std::endl;
  std::cout << "num_vec2 begin element: " << num_vec2.front() << std::endl;
  std::cout << "num_vec2 end element: " << num_vec2.back() << std::endl;

  int numsize = num_vec1.size();
  std::cout << "erase test" << std::endl;
  num_vec1.erase(num_vec1.begin(), num_vec1.begin()+numsize);
  std::cout << "num_vec1 size(): " << num_vec1.size() << std::endl;
  std::cout << "num_vec1 capity()" << num_vec1.capacity() << std::endl;

  return 0;
}